package cn.young.javalearning.designpattern.singleton.hungry;

/**
 * 饿汉模式
 */
public class HungryStaticSingleton {
    private static final HungryStaticSingleton HUNGRY_SINGLETON;

    static {
        HUNGRY_SINGLETON = new HungryStaticSingleton();
    }

    private HungryStaticSingleton(){}

    public static final HungryStaticSingleton getInstance(){
        return HUNGRY_SINGLETON;
    }

    public void test(Integer integer){
        System.out.println("this is hungry singleton pattern!" + integer);
    }
}
